<!--
  Generated template for the BadPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

    <ion-navbar>
        <ion-title>故障列表</ion-title>
    </ion-navbar>

</ion-header>


<ion-content>
    <ion-refresher (ionRefresh)="doRefresh($event)">
        <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="下拉刷新" refreshingSpinner="bubbles" refreshingText="正在刷新...">
        </ion-refresher-content>
    </ion-refresher>

    <ion-searchbar placeholder="输入设备编号" [(ngModel)]="searchKey" [showCancelButton]="true" cancelButtonText="取消" (ionInput)="searchOnHandler($event)"
        (ionCancel)="searchOnCancel($event)"></ion-searchbar>

    <loading-spinner [isReady]="isReady" [isShow]='isLoading' [isNoData]="!isLoading&&list.length == 0"></loading-spinner>
    <div class="bad-list">
        <a class="bad-item" *ngFor="let item of list" (click)="pToDetail(item)">
            <p class="item-content">{{item.physicalCode }}【{{item.content }}】</p>
            <p class="item-desc">
                <span *ngIf="item.status == 0" class="deal-span deal-span-0">未处理</span>
                <span *ngIf="item.status == 1" class="deal-span deal-span-1">处理中</span>
                <span *ngIf="item.status == 2" class="deal-span deal-span-2">已处理</span>
                &emsp;|&emsp;
                <span class="item-type">
                    {{item.type | devPipe: 'badType'}}
                </span>
                <span class="item-time">
                        &emsp;|&emsp;{{item.createTime | dateFormatPipe:"yyyy-MM-dd hh:mm"}}
                </span>
            </p>
        </a>
    </div>

    <ion-infinite-scroll *ngIf="!pageObj.isLastPage" (ionInfinite)="doInfinite($event)">
        <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="加载中...">
        </ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>